package com.avery.mile.hadoop.rpc;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.ProtocolProxy;
import org.apache.hadoop.ipc.RPC;
import org.apache.log4j.BasicConfigurator;

import java.io.IOException;
import java.net.InetSocketAddress;

public class MyClient {
    public static void main(String[] args) {
        BasicConfigurator.configure();
        try {
            ProtocolProxy<BizProtocol> proxy = RPC.waitForProtocolProxy(BizProtocol.class, 1L, new InetSocketAddress(9000), new Configuration());
            BizProtocol proxy1 = proxy.getProxy();
            String avery = proxy1.sayHello("avery");
            System.out.println("==============" + avery);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
